import request from '@/utils/request'

// 查询策略生成列表
export function listStrategy(query) {
  return request({
    url: '/system/strategy/list',
    method: 'get',
    params: query
  })
}

// 查询策略生成详细
export function getStrategy(strategyNm) {
  // alert(strategyNm);
  return request({
    url: '/system/strategy/' + strategyNm,
    method: 'get'
  })
}

// 新增策略生成
export function addStrategy(data) {
  return request({
    url: '/system/strategy',
    method: 'post',
    data: data
  })
}
// 策略执行
export function ExecutePython(strategyCd,dateRange) {
  // alert(dateRange);
  // return

  return request({
    url: '/system/strategy/executePython',
    method: 'put',
    data:{strategyCd:strategyCd,dateRange:dateRange}
  })
}

// 修改策略生成
export function updateStrategy(data) {
  return request({
    url: '/system/strategy',
    method: 'put',
    data: data
  })
}
// 分析
export function importOne(url) {
  return request({
    url: url,
    method: 'get'
  })
}

// 删除策略生成
export function delStrategy(strategyNm) {
  return request({
    url: '/system/strategy/' + strategyNm,
    method: 'delete'
  })
}
